home *** CD-ROM | disk | FTP | other *** search
/ Packard Bell - Internet on a CD / internet on a cd.cdr / Internet / sites / Clementine_NASA / clemdsrc.hqx / FrmDefItem.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-24  |  1.2 KB  |  46 lines

  1. /***********************************************************************************
  2. *  Highlights default buttons - Written by Janet Barrett at USGS, Flagstaff
  3. ***********************************************************************************/
  4. /* Standard C includes */
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. /* Macintosh toolbox includes */
  10. #include <Packages.h>
  11. #include <asm.h>
  12. #include <Traps.h>
  13.  
  14. void FrmDefItem(DialogPtr theDialog)
  15. {
  16.   short        theItemID;
  17.   short        itemType;
  18.   Rect        itemRect;
  19.   Handle    itemHandle;
  20.   PenState     penStuff;
  21.   short        curveFactor;
  22.   GrafPtr    savePort;
  23.   short        hasColor = 0;
  24.   SysEnvRec    sysEnvRec;
  25.   #define     SysEnvironsTrap 0xA090
  26.   #define    UnknownTrap 0xA89F
  27.   
  28.   if ((long)NGetTrapAddress(SysEnvironsTrap,OSTrap) !=
  29.       (long)NGetTrapAddress(UnknownTrap,ToolTrap)) {
  30.     SysEnvirons(1,&sysEnvRec);
  31.     hasColor = sysEnvRec.hasColorQD;
  32.   }
  33.   theItemID = 1;
  34.   GetPort(&savePort);
  35.   SetPort(theDialog);
  36.   GetPenState(&penStuff);
  37.   GetDItem(theDialog,theItemID,&itemType,&itemHandle,&itemRect);
  38.   PenNormal();
  39.   PenSize(3,3);
  40.   InsetRect(&itemRect,-4,-4);
  41.   curveFactor = (itemRect.bottom+8-itemRect.top)/2;
  42.   FrameRoundRect(&itemRect,curveFactor,curveFactor);
  43.   SetPenState(&penStuff);
  44.   SetPort(savePort);
  45. }
  46.